package com.xuecheng.teaching.agent;

import com.xuecheng.api.content.model.dto.CoursePubDTO;
import com.xuecheng.api.teaching.model.dto.TeachplanWorkDTO;
import com.xuecheng.common.constant.XcFeignServiceNameList;
import com.xuecheng.common.domain.response.RestResponse;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

import java.util.List;

@FeignClient(value = XcFeignServiceNameList.XC_CONTENT_SERVICE)
public interface CourseBaseApiAgent {

//    String PRE_SUFFIX = "/content/course";

    @GetMapping("/content/course/l/{courseBaseId}")
    CoursePubDTO getCourseBaseByIdNoCompanyId(@PathVariable Long courseBaseId);

    //根据workId 远程调用teachplan_work  查询课程计划teachplan_id  是否绑定

    @GetMapping("/content/l/teachplan/work/{workId}")
    RestResponse<List<TeachplanWorkDTO>> getByWorkId4s(@PathVariable Long workId);

    //远程调用-课程内容管理服务-根据课程名称查找coursePub的id
    @GetMapping("/content/l/coursePub/{courseName}")
    RestResponse<CoursePubDTO> getByCourseName4s(@PathVariable String courseName);

    //远程调用-课程内容管理服务-根据课程id查找coursePub信息
    @GetMapping("/content/l/coursePub/name/{coursePubId}")
    RestResponse<CoursePubDTO> getByCourse4s(@PathVariable Long coursePubId);

    //远程调用-课程内容管理服务-根据课程id查找coursePub信息
    @GetMapping("/content/l/coursePubName/{workId}")
    RestResponse<List<String>> getCoursePubByWorkId4s(@PathVariable("workId") Long workId);
}
